
<?php
        @session_start();
	include ('cnn/cnn.php');
	
	$cnn = cnn();	
	//$query = 'select * from preguntas';
        $query = 'SELECT p.pregunta,cp.Clasificacion,p.Grupo_Preguntas,cp.id,p.id as Id_P FROM preguntas p, clasificacion_preg cp where p.clasificacion=cp.id';
	$ex = mysql_query ($query, $cnn) or die(mysql_error());
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>Registro</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/mm_training.css" type="text/css" />
<link rel="stylesheet" href="css/default.css" type="text/css" />
<link rel="stylesheet" href="css/NLForm.css" type="text/css" />
<link rel="stylesheet" href="css/menu_style2.css" type="text/css" />
<script language="javascript" src="js/jquery-1.3.1.min.js"></script>
<script language="javascript" src="js/Ocultar.js"></script>
<script language="javascript" src="js/Envio_Ajax_Jquery.js"></script>
<style type="text/css">
<!--
.Estilo1 {
	font-size: 36px;
	font-weight: bold;
}
.Estilo2 {color: #FF0000}
.Estilo3 {
	color: #FF3300;
	font-size: 16px;
	font-weight: bold;
}
-->
</style>
<style type="text/css">
#tema #contenido div.border-bottom h2 {font-size:13px; font-family:Verdana; font-weight:bold; color:#000; margin-left:1em;}
#tema #contenido ul.radiobutton-h li {background-image: none;}
</style>

</head>
<body bgcolor="#64748B">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr bgcolor="#26354A">
	<td width="15" nowrap="nowrap"><img src="Imagenes/logoitsz.GIF" alt="" width="172" height="106" /></td>
	<td height="70" colspan="2" class="logo" nowrap="nowrap"> D E C I D E <span class="Estilo1">T</span> <span class="tagline">| DEFINE TU FUTURO</span></td>
	<td width="100%">&nbsp;</td>
	</tr>

	<tr bgcolor="#FF6600">
	<td colspan="4"><img src="Imagenes/mm_spacer.gif" alt="" width="1" height="4" border="0" /></td>
	</tr>

	<tr bgcolor="#D3DCE6">
	<td colspan="4"><img src="Imagenes/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
	</tr>

	<tr bgcolor="#FFCC00">
	<td width="15" nowrap="nowrap">&nbsp;</td>
	<td width="705" colspan="2" height="24">
	<table border="0" cellpadding="0" cellspacing="0" id="navigation">
        <tr>
          <td class="navText" align="center" nowrap="nowrap"></td>
        </tr>
      </table>	</td>
	<td width="100%">&nbsp;</td>
	</tr>

	<tr bgcolor="#D3DCE6">
	<td colspan="4"><img src="Imagenes/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
	</tr>

	<tr bgcolor="#FF6600">
	<td colspan="4"><img src="Imagenes/mm_spacer.gif" alt="" width="1" height="4" border="0" /></td>
	</tr>

	<tr bgcolor="#D3DCE6">
	<td colspan="4"><img src="Imagenes/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
	</tr>

	<tr bgcolor="#D3DCE6">
            <td width="15" valign="top" nowrap>&nbsp;
                <br/>
                <? echo "Registro:".$_SESSION['Id_Aspirante']."<br/>Bienvenido:".$_SESSION['Aspirante'] ?>
                <br/>
                Clasificacion de las Preguntas
                <br/>
                <br/>
<div class="menuContainer">

        <div class="outer">
	<div id="menu">
        <ul>
            <?php
                            $cnn1 = cnn();
                            $query1 = "select max(id) as num from clasificacion_preg";
                            $ex1 = mysql_query ($query1, $cnn1) or die(mysql_error());
                            while($row1 = mysql_fetch_array($ex1))
                                {
                                    echo "<input type='hidden' id='NClas' name='NClas' value=".$row1["num"].">";

                                }
                            ?>
        <?php
                            $cnn1 = cnn();
                            $query1 = "select * from clasificacion_preg";
                            $ex1 = mysql_query ($query1, $cnn1) or die(mysql_error());
                            while($row1 = mysql_fetch_array($ex1))
                                {
                                    echo "<li><a href='#' target='_self' onclick=\"st('d".$row1["Id"]."','".$row1["Clasificacion"]."')\">".$row1["Clasificacion"]."</a></li>";
                                    
                                }
                            ?>
            </ul>
            </div>
            </div>
    </div>
        
        </td>

	<td width="35"><img src="Imagenes/mm_spacer.gif" alt="" width="35" height="1" border="0" /></td>
	<td width="710" valign="top"><br />
	&nbsp;<br />
       <form method="post" name="myform" id="myform" action="Guardar_Inf.php" >
	<table border="0" cellspacing="0" cellpadding="2" width="910" >
        <tr>
          <td colspan="3">
              <div id="Selcla" name="Selcla"><h2>Seleccione Una Clasificacion</h2></div>

          <?php 
		    $n = 1;    
		  	while($row = mysql_fetch_array($ex))
			{			
		  ?>
          <!--class="border-bottom"-->
                <input type="hidden" id="preg" name="preg[]" value="<?php echo $row["Id_P"];?>" />
                

                <div class="d<?php echo $row["id"];?>" id="d<?php echo $row["id"];?>" name="d<?php echo $row["id"];?>" style="background-color: #E2E2E2;border-bottom-color: #FFFFFF;display: none"><fieldset style="border:#000000">
                        <h2><a href="#" onclick="Mostrar_Preg('O<?php echo $n;?>')"><?php echo $n;?>. <?php echo utf8_encode($row["pregunta"]);?></a></h2>
                        <div id="O<?php echo $n;?>" name="O<?php echo $n;?>">
                        <ul class="radiobutton-h">
                            <?php
                            $cnn1 = cnn();
                            $query1 = "select * from respuestas where Id_Grupo=".$row["Grupo_Preguntas"];
                            $ex1 = mysql_query ($query1, $cnn1) or die(mysql_error());
                            echo "<li class='n1 opcion'>";
                            echo "<table id='tabla".$n."'><tr><td><input type='hidden' id='Res[]' name='Res[]' value=1></td>";
                            while($row1 = mysql_fetch_array($ex1))
                                {
                                    //echo "<input class='field radio' type='radio' onclick='llena(4);' name='r4' value='1' />".$row1["Respuesta"];
                                    echo "<td align='center'>&nbsp;<img id='im".$n."'src='Respuestas_Imagen.php?Imagen=".$row1["id"]."' width='100px' height='100px' onclick=\"resp('r".$n."',this,'tabla".$n."','".$row1["id"]."'),Ocultar_Preg('O".$n."')\"/>&nbsp;<br>".$row1["Respuesta"]."</td>";
                                }
                                echo "<td> Tu Respuesta es</td><td><img id='r".$n."' src='Imagenes/Pregunta.jpg' width='100px' height='100px' /></td></tr></table>";
                            echo "</li>";
                            ?>
                </ul></div></fieldset></div>
                   

           <?php $n++;}#end while?>
          
        </td>
            
            <td valign="top" >
                <div style="background-color: blanchedalmond" >
                    <br/>
            Instrucciones:
            <ul>

            <li>Selecciona cada una de la Clasificacion de las Preguntas.</li>
            <li>Llena todas las preguntas de cada Clasificacion.</li>
            <li>Presiona el boton enviar para  que tus preguntas sean procesadas.</li>
            </ul>
            <br/>
            </div>
                <img id='Guar' name='Guar' src="Imagenes/Enviar.jpg" style='cursor:pointer' alt="Enviar Informacion."/>
                <br/>
                <div id="result" name="result">
                    Esperando Proceso...
                    </div>


        </td>

        </tr>
        <tr>
         <td width="309" class="subHeader">&nbsp;</td>
		  <td width="1" rowspan="2">&nbsp;</td>
		  <td width="288" height="100" rowspan="2">&nbsp;</td>
        </tr>
        <tr>
          <td valign="top" class="bodyText"><p>&nbsp;</p>
            <p>&nbsp;</p>
          </td>
        </tr>
      </table>
           </form>
	 <br />	</td>
	<td>&nbsp;</td>
        
	</tr>

	<tr bgcolor="#64748B">
	<td width="15">&nbsp;<br />
	&nbsp;<br />	</td>
    <td width="35">&nbsp;</td>
    <td width="710">&nbsp;</td>
	<td width="100%">&nbsp;</td>
  </tr>
</table>
</body>
</html>
